/**
 * 
 */
package org.jenkon.commons.lang.validator;

import java.util.List;

/**
 * @author Jens Konopka
 * 
 * @param <T>
 */
public class AndValidator<T> extends AbstractConditionValidator<T> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1979800508842562416L;

	/*
	 * (non-Javadoc)
	 * 
	 * @see
	 * org.jenkon.commons.validator.AbstractConditionValidator#validate(java
	 * .lang.Object, java.util.List)
	 */
	@Override
	protected boolean validate(T value, List<Validator<T>> validators)
			throws Exception {
		for (final Validator<T> validator : validators) {
			if (!validator.validate(value)) {
				return false;
			}
		}
		return true;
	}

}
